<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Create a collator</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="collator.construct.html">Collator::__construct</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="collator.getattribute.html">Collator::getAttribute</a></div>
 <div class="up"><a href="class.collator.html">Collator</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="collator.create" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Collator::create</h1>
  <h1 class="refname">collator_create</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0, PECL intl &gt;= 1.0.0)</p><p class="refpurpose"><span class="refname">Collator::create</span> -- <span class="refname">collator_create</span> &mdash; <span class="dc-title">Create a collator</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-collator.create-description">
  <h3 class="title">说明</h3>
  <p class="para">面向对象风格</p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="modifier">static</span>
   <span class="type"><a href="class.collator.html" class="type Collator">Collator</a></span> 
   <span class="methodname"><strong>Collator::create</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$locale</code></span>
   )</div>

  <p class="para rdfs-comment">
   过程化风格
  </p>
  <div class="methodsynopsis dc-description">
   <span class="type"><a href="class.collator.html" class="type Collator">Collator</a></span> 
   <span class="methodname"><strong>collator_create</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$locale</code></span>
   )</div>

  <p class="para rdfs-comment">
   The strings will be compared using the options already specified.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-collator.create-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">locale</code></em></dt>

     <dd>

      <p class="para">
       The locale containing the required collation rules. Special values for
       locales can be passed in - if null is passed for the locale, the
       default locale collation rules will be used. If empty string (&quot;&quot;) or
       &quot;root&quot; are passed, <a href="http://www.unicode.org/reports/tr10/" class="link external">&raquo;&nbsp;UCA</a> rules will be used.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>



 <div class="refsect1 returnvalues" id="refsect1-collator.create-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Return new instance of <a href="class.collator.html" class="classname">Collator</a> object, or <strong><code>NULL</code></strong>
   on error.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-collator.create-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2426">
    <p><strong>Example #1 <span class="function"><strong>collator_create()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$coll&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">collator_create</span><span style="color: #007700">(&nbsp;</span><span style="color: #DD0000">'en_US'&nbsp;</span><span style="color: #007700">);<br /><br />if(&nbsp;!isset(&nbsp;</span><span style="color: #0000BB">$coll&nbsp;</span><span style="color: #007700">)&nbsp;)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">printf</span><span style="color: #007700">(&nbsp;</span><span style="color: #DD0000">"Collator&nbsp;creation&nbsp;failed:&nbsp;%s\n"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">intl_get_error_message</span><span style="color: #007700">()&nbsp;);<br />&nbsp;&nbsp;&nbsp;&nbsp;exit(&nbsp;</span><span style="color: #0000BB">1&nbsp;</span><span style="color: #007700">);<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-collator.create-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="collator.construct.html" class="function" rel="rdfs-seeAlso">Collator::__construct()</a> - Create a collator</span></li>
   </ul>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="collator.construct.html">Collator::__construct</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="collator.getattribute.html">Collator::getAttribute</a></div>
 <div class="up"><a href="class.collator.html">Collator</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
